package com.cyw.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cyw.pojo.Permission;
import com.cyw.pojo.Role;
import org.apache.ibatis.annotations.Select;

import java.util.Set;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author cyw
 * @since 2022-10-30
 */
public interface RoleMapper extends BaseMapper<Role> {
    // 获取角色所拥有权限
    @Select("select * from permission where permission_code in (select permission_code from role_permission where role_code = #{roleCode})")
    public Set<Permission> getRolePermissions(String roleCode);
}
